<template>
	<view class="Allhistory">
		<view class="charttop">
			<view class="top1">
				<text class="word">历史对比</text>
			</view>
			<view class="charts-box">
				<qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
			</view>
		</view>
		<view class="center">
			<view class="first">
				<view class="exmain_porj">
					检查项目
				</view>
				<view class="proj_name">
					血红蛋白
				</view>
			</view>
			<view class="first">
				<view class="exmain_porj">
					缩写
				</view>
				<view class="proj_name">
					ALT
				</view>
			</view>
			<view class="first">
				<view class="exmain_porj">
					测量结果
				</view>
				<view class="proj_name">
					14
				</view>
			</view>
			<view class="first">
				<view class="exmain_porj">
					参考区间
				</view>
				<view class="proj_name">
					14-41
				</view>
			</view>
			<view class="first">
				<view class="exmain_porj">
					单位
				</view>
				<view class="proj_name">
					U/L
				</view>
			</view>
			<view class="first">
				<view class="exmain_porj">
					提示
				</view>
				<view class="proj_name">

				</view>

			</view>
		</view>
		<view class="bottom">
			<button type="button" class="btn" @click="close">关闭</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				chartData: {},
				//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数，如都是默认参数，此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式，达到页面简洁的需求。
				opts: {
					color: ["#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [15, 10, 0, 15],
					enableScroll: false,
					legend: {},
					xAxis: {
						disableGrid: true
					},
					yAxis: {
						gridType: "dash",
						dashLength: 2
					},
					extra: {
						line: {
							type: "straight",
							width: 2,
							activeType: "hollow"
						}
					},
					extra: {
						markLine: {
							type: "dash",
							data: [{
									value: 49,
									lineColor: "#f04864",
									showLabel: true
								},
								{
									value: 14,
									lineColor: "#00cd00",
									showLabel: true
								}
							]
						},
					}
				}
			};
		},

		onReady() {
			this.getServerData();
		},
		methods: {
			getServerData() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						categories: ["21/05", "22/05", "23/05"],
						series: [{
								name: "",
								data: [28, 49, 14]
							},

						]
					};
					this.chartData = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			close(){
				uni.navigateTo({
					url: '/page_report/report_allexamin/report_allexamin'
				});
			}
		}
	};
</script>

<style scoped lang="less">
	.Allhistory {
		background-color: #F4F6F6;
		width: 100%;

		.top1 {
			width: 100%;
			height: 112rpx;

			.word {
				height: 112rpx;
				line-height: 152rpx;
				margin-left: 30rpx;
				color: #969FA2;
				font-size: 24rpx;
			}
		}

		.charts-box {
			background-color: white;
			width: 100%;
			height: 410rpx;
		}

		.center {
			margin-top: 10rpx;
			background-color: white;
			width: 100%;

			.first {
				width: 100%;
				height: 88rpx;
				display: flex;
				line-height: 88rpx;

				.exmain_porj {
					width: 180rpx;
					height: 88rpx;
					font-size: 32rpx;
					margin-left: 40rpx;
					font-weight: 300;
				}

				.proj_name {
					width: 240rpx;
					height: 88rpx;
					font-size: 28rpx;
					color: #969FA2;
					margin-left: 50rpx;
				}
			}
		}

		.bottom {
			position: relative;

			.btn {
				// margin-top: 100rpx;
				position: absolute;
				top: 224rpx;
				bottom: 0;
				width: 100%;
				height: 96rpx;
				background: #59B58D;
				color: white;
			}
		}
	}
</style>